defaultButton
Type
property
Summary
Reports the long ID of the current card's default button.
Syntax
get the defaultButton of <card>
Description
Use the defaultButton property to find out which button on a card is designated as the button to be clicked when the user presses the Return or Enter key.
The defaultButton property returns the long ID of the button whose default property is set to true.
When the user presses Enter or Return and there is no active control, LiveCode sends a mouseUp message to the defaultButton. (If the card contains an editable field, handle the returnInField and enterInField messages to ensure that the default button is activated.)
If more than one button's default is true, the defaultButton property reports the ID of the button whose default property was set to true most recently. This property reports empty if there is no default button.
Examples
send mouseUp to the defaultButton of this card
Related
message: returnInField, enterInField
glossary: property, current card, handle, return, message, card, field
keyword: default, card, button
Compatibility and Support
Introduced
LiveCode 1.0
OS
mac
windows
linux
ios
android
Platforms
desktop
server
mobile